#ifndef INFINITY_CHARACTERE_ENTITY_H
#	define INFINITY_CHARACTERE_ENTITY_H

#include "entity3D.h"
#include "servicephysics.h"
#include "inputs/command.h"
#include "container.h"
#include "collectibleentity.h"

namespace infinity {

class CharactereEntity
	:	public Entity3D
{
public : //! @name Constants
	//! @{
	static const dw::float32 InfiniteTime;
	//! @}

public : //! @name Types definitions
	//! @{
	typedef Entity3D super;
	//! @}

public : //! @name Entity Commands
	//! @{
	virtual void renderDebug();
	//! @}

public : //! @name Setup
	//! @{
	void setInitialPosition(const Vector3f& position);
	void setInitialVelocity(const Vector3f& velocity);

	physics::Object* getPhysiqueObject();
	virtual const Matrix4f& getMatrix();

	Container* getContainer();
	//! @}

protected : //! @name Construction & Destruction
	//! @{
	friend class ServiceEntity;

	CharactereEntity();
	virtual ~CharactereEntity();
	//! @}

protected : //! @name Callbacks
	//! @{
	virtual State onInitializeSimulation();
	virtual void onUpdateSimulation(dw::float32 deltaT);
	virtual State onTerminateSimulation();

	virtual State onInitializeMedia();
	virtual void onUpdateMedia(dw::float32 deltaT);
	virtual State onTerminateMedia();
	//! @}


private : 
	//! @{
	float evalCollectibleDistance(CollectibleEntity *);
	//! @}

private : //! @name Data
	//! @{
	float	m_vitesse;
	physics::Object* m_physicObject;
	Vector3f m_initialPosition;
	Vector3f m_initialVelocity;

	Container * m_container;
	
	dw::inputs::InputCommand m_moveObjectForward;
	dw::inputs::InputCommand m_moveObjectBackward;
	dw::inputs::InputCommand m_rotateObjectLeft;
	dw::inputs::InputCommand m_rotateObjectRight;
	dw::inputs::InputCommand m_jumpObject;
	//! @}
};

} // namespace infinity

#include "charactereentity.inl"

#endif // !INFINITY_CHARACTERE_ENTITY_H
